package com.stu.exercise.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.stu.exercise.entity.Orders;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface OrdersMapper extends BaseMapper<Orders> {
    @Select("select o.*, c.`name` cname, e.`name` ename from orders o, customer c, equipment e where o.user_id = c.id and e.id = o.equipment_id and order_number like concat('%', #{map.orderNumber}, '%')")
    List<Orders> selectOrders(@Param("map") Map<String, Object> map);
}
